<!--代码逻辑和样式库-->
<script src="./device-info.component.js"></script>
<style src="./device-info.scss" lang="scss" scoped></style>

<template>
  <div>
    <el-dialog title="设备注册信息" :visible.sync="showDialogFlag" width="1000px">
      <el-row :gutter="20">
        <el-col :span="24" class="color-gray" align="center">
          <span class="aq-margin-right-16">设备编码: {{ selectedData.deviceNum }}</span>
          <span class="aq-margin-right-16">首次上电时间: {{ dateString(deviceInfo.fdt) }}</span>
          <span class="aq-margin-right-16">最近更新时间: {{ dateString(deviceInfo.udt) }}</span>
        </el-col>
      </el-row>
      <el-form label-width="120px" class="aq-margin-top-16">
        <el-form-item label="所属组织:">
          <el-input v-model="reviewInfo.cooperName" disabled></el-input>
        </el-form-item>
        <el-form-item label="所属地区:">
          <el-input v-model="reviewInfo.area" disabled></el-input>
        </el-form-item>
        <el-form-item label="车主姓名:">
          <el-input v-model="reviewInfo.ownername" :disabled="reviewInfo.ownernameDisabled"></el-input>
          <el-button v-if="userInfo.usertype == 'admin'" type="primary" @click="reviewInfo.ownernameDisabled=false">编辑</el-button>
          <el-button v-if="userInfo.usertype == 'admin'" type="success" @click="updateInfo()">提交</el-button>
        </el-form-item>
        <el-form-item label="车主电话:">
          <el-input v-model="reviewInfo.ownerphone" :disabled="reviewInfo.ownerphoneDisabled"></el-input>
          <el-button v-if="userInfo.usertype == 'admin'" type="primary" @click="reviewInfo.ownerphoneDisabled=false">编辑</el-button>
          <el-button v-if="userInfo.usertype == 'admin'" type="success" @click="updateInfo()">提交</el-button>
        </el-form-item>
        <el-form-item label="身份证号码:">
          <el-input v-model="reviewInfo.idcard" :disabled="reviewInfo.idcardDisabled"></el-input>
          <el-button v-if="userInfo.usertype == 'admin'" type="primary" @click="reviewInfo.idcardDisabled=false">编辑</el-button>
          <el-button v-if="userInfo.usertype == 'admin'" type="success" @click="updateInfo()">提交</el-button>
        </el-form-item>
        <el-form-item label="银行卡号码:">
          <el-input v-model="reviewInfo.bankcard" :disabled="reviewInfo.bankcardDisabled"></el-input>
          <el-button v-if="userInfo.usertype == 'admin'" type="primary" @click="reviewInfo.bankcardDisabled=false">编辑</el-button>
          <el-button v-if="userInfo.usertype == 'admin'" type="success" @click="updateInfo()">提交</el-button>
        </el-form-item>
        <el-form-item label="农机类型:">
          <el-input v-model="reviewInfo.tractorTypeDes" disabled></el-input>
        </el-form-item>
        <el-form-item label="农机品牌:">
          <el-input v-model="reviewInfo.facturer" :disabled="reviewInfo.facturerDisabled"></el-input>
          <el-button v-if="userInfo.usertype == 'admin'" type="primary" @click="reviewInfo.facturerDisabled=false">编辑</el-button>
          <el-button v-if="userInfo.usertype == 'admin'" type="success" @click="updateInfo()">提交</el-button>
        </el-form-item>
        <el-form-item label="农机马力值:">
          <el-input v-model="reviewInfo.power" :disabled="reviewInfo.powerDisabled"></el-input>
          <el-button v-if="userInfo.usertype == 'admin'" type="primary" @click="reviewInfo.powerDisabled=false">编辑</el-button>
          <el-button v-if="userInfo.usertype == 'admin'" type="success" @click="updateInfo()">提交</el-button>
        </el-form-item>
        <el-form-item label="车牌号:">
          <el-input v-model="reviewInfo.enumber" :disabled="reviewInfo.enumberDisabled"></el-input>
          <el-button v-if="userInfo.usertype == 'admin'" type="primary" @click="reviewInfo.enumberDisabled=false">编辑</el-button>
          <el-button v-if="userInfo.usertype == 'admin'" type="success" @click="updateInfo()">提交</el-button>
        </el-form-item>
        <el-form-item label="发动机号:">
          <el-input v-model="reviewInfo.engineno" :disabled="reviewInfo.enginenoDisabled"></el-input>
          <el-button v-if="userInfo.usertype == 'admin'" type="primary" @click="reviewInfo.enginenoDisabled=false">编辑</el-button>
          <el-button v-if="userInfo.usertype == 'admin'" type="success" @click="updateInfo()">提交</el-button>
        </el-form-item>
        <el-form-item label="架子号:">
          <el-input v-model="reviewInfo.frameno" :disabled="reviewInfo.framenoDisabled"></el-input>
          <el-button v-if="userInfo.usertype == 'admin'" type="primary" @click="reviewInfo.framenoDisabled=false">编辑</el-button>
          <el-button v-if="userInfo.usertype == 'admin'" type="success" @click="updateInfo()">提交</el-button>
        </el-form-item>
        <el-form-item label="出厂编号:">
          <el-input v-model="reviewInfo.factoryno" :disabled="reviewInfo.factorynoDisabled"></el-input>
          <el-button v-if="userInfo.usertype == 'admin'" type="primary" @click="reviewInfo.factorynoDisabled=false">编辑</el-button>
          <el-button v-if="userInfo.usertype == 'admin'" type="success" @click="updateInfo()">提交</el-button>
        </el-form-item>
        <el-form-item label="农具型号:">
          <el-input v-model="reviewInfo.ttype" disabled></el-input>
        </el-form-item>
        <el-form-item label="作业类型:">
          <el-input v-model="reviewInfo.workTypeDes" disabled></el-input>
        </el-form-item>
        <el-form-item label="最大幅宽(米):">
          <el-input v-model="reviewInfo.width" :disabled="reviewInfo.widthDisabled"></el-input>
          <el-button v-if="userInfo.usertype == 'admin'" type="primary" @click="reviewInfo.widthDisabled=false">编辑</el-button>
          <el-button v-if="userInfo.usertype == 'admin'" type="success" @click="updateInfo()">提交</el-button>
        </el-form-item>
        <el-form-item label="终端ID:">
          <el-input v-model="reviewInfo.tmcid" disabled></el-input>
        </el-form-item>
        <el-form-item label="物联网卡号:">
          <el-input v-model="reviewInfo.cardno" disabled></el-input>
        </el-form-item>
        <el-form-item label="安装人员:">
          <el-input v-model="machineInfo.reviewername" disabled></el-input>
        </el-form-item>
        <el-form-item label="安装人员电话:">
          <el-input v-model="machineInfo.reviewerphone" disabled></el-input>
        </el-form-item>
        <el-form-item label="申请时间:">
          <el-input v-model="reviewInfo.registerDate" disabled></el-input>
        </el-form-item>
        <el-form-item label="安装备注:">
          <el-input v-model="reviewInfo.remarks" :disabled="reviewInfo.remarksDisabled"></el-input>
          <el-button v-if="userInfo.usertype == 'admin'" type="primary" @click="reviewInfo.remarksDisabled=false">编辑</el-button>
          <el-button v-if="userInfo.usertype == 'admin'" type="success" @click="updateInfo()">提交</el-button>
        </el-form-item>
      </el-form>
      <el-divider>设备审核照片</el-divider>
      <el-row :gutter="20" type="flex">
        <el-col :span="12" align="center">
          <div class="color-gray aq-margin-bottom-12">
            身份证银行卡
          </div>
          <a target="_blank" :href="file_url + reviewInfo.photo6">
            <img v-if="reviewInfo.photo6" :src="file_url + reviewInfo.photo6" alt="身份证银行卡" class="width-full">
          </a>
        </el-col>
        <el-col :span="12" align="center">
          <div class="color-gray aq-margin-bottom-12">
            人机合影
          </div>
          <a target="_blank" :href="file_url + reviewInfo.photo1">
            <img v-if="reviewInfo.photo1" :src="file_url + reviewInfo.photo1" alt="人机合影" class="width-full">
          </a>
        </el-col>
      </el-row>
      <el-row :gutter="20" type="flex" class="aq-margin-top-16">
        <el-col :span="12" align="center">
          <div class="color-gray aq-margin-bottom-12">
            农具全貌
          </div>
          <a target="_blank" :href="file_url + reviewInfo.photo2">
            <img v-if="reviewInfo.photo2" :src="file_url + reviewInfo.photo2" alt="农具全貌" class="width-full">
          </a>
        </el-col>
        <el-col :span="12" align="center">
          <div class="color-gray aq-margin-bottom-12">
            终端出厂编号
          </div>
          <a target="_blank" :href="file_url + reviewInfo.photo3">
            <img v-if="reviewInfo.photo3" :src="file_url + reviewInfo.photo3" alt="终端出厂编号" class="width-full">
          </a>
        </el-col>
      </el-row>
      <el-row :gutter="20" type="flex" class="aq-margin-top-16">
        <el-col :span="12" align="center">
          <div class="color-gray aq-margin-bottom-12">
            摄像头位置
          </div>
          <a target="_blank" :href="file_url + reviewInfo.photo4">
            <img v-if="reviewInfo.photo4" :src="file_url + reviewInfo.photo4" alt="摄像头位置" class="width-full">
          </a>
        </el-col>
        <el-col :span="12" align="center">
          <div class="color-gray aq-margin-bottom-12">
            幅宽测量
          </div>
          <a target="_blank" :href="file_url + reviewInfo.photo5">
            <img v-if="reviewInfo.photo5" :src="file_url + reviewInfo.photo5" alt="幅宽测量" class="width-full">
          </a>
        </el-col>
      </el-row>
      <el-row :gutter="20" type="flex" class="aq-margin-top-16">
        <el-col :span="12" align="center">
          <div class="color-gray aq-margin-bottom-12">
            传感器位置
          </div>
          <a target="_blank" :href="file_url + reviewInfo.photo7">
            <img v-if="reviewInfo.photo7" :src="file_url + reviewInfo.photo7" alt="传感器位置" class="width-full">
          </a>
        </el-col>
        <el-col :span="12" align="center">
          <div class="color-gray aq-margin-bottom-12">
            天线安装位置
          </div>
          <a target="_blank" :href="file_url + reviewInfo.photo8">
            <img v-if="reviewInfo.photo8" :src="file_url + reviewInfo.photo8" alt="天线安装位置" class="width-full">
          </a>
        </el-col>
      </el-row>
      <el-row :gutter="20" type="flex" class="aq-margin-top-16">
        <el-col :span="12" align="center">
          <div class="color-gray aq-margin-bottom-12">
            安装确认单
          </div>
          <a target="_blank" :href="file_url + reviewInfo.photo9">
            <img v-if="reviewInfo.photo9" :src="file_url + reviewInfo.photo9" alt="安装确认单" class="width-full">
          </a>
        </el-col>
      </el-row>
      <el-divider type="dash"></el-divider>
      <el-row class="aq-margin-top-16">
        <el-col :span="24" align="center">
          <el-button v-if="userInfo.usertype == 'admin'" type="danger" @click="remove()">确认删除</el-button>
        </el-col>
      </el-row>
    </el-dialog>
  </div>
</template>
